local boni = fk.CreateSkill({
  name = "js__boni",
})

boni:addEffect("active", {
  anim_type = "offensive",
  card_num = 1,
  target_num = 2,
  prompt = "悖逆：将锦囊牌当目标无需合法的【借刀杀人】使用",
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeTrick and table.contains(player:getHandlyIds(), to_select)
  end,
  target_filter = function(self, player, to_select, selected)
    return #selected < 2
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:useVirtualCard("collateral", effect.cards, player, effect.tos, boni.name)
    if #player.room.logic:getActualDamageEvents(1, function(e)
        return e.data.card.trueName == "slash"
      end, Player.HistoryPhase) == 0 then
        if #target:getCardIds("hej")~=0 then
          local card = player.room:askToChooseCard(player, { target = target, flag = "hej", skill_name = boni.name})
          player.room:obtainCard(player, card, false, fk.ReasonPrey, player, boni.name)
        end
    end
  end,
})

Fk:loadTranslationTable {
["js__boni"] = "悖逆",
[":js__boni"] = "你可以将锦囊牌当目标无需合法的【借刀杀人】使用，然后若本回合未有角色受到【杀】造成的伤害，你获得其区域内一张牌。",
["$js__boni1"] = "臣等忠心耿耿，陛下何故谋反？",
["$js__boni2"] = "公等养汝，正拟今日，复何疑！",
}
return boni